home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / CURRENT.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  407b  |  24 lines

  1. #ifndef _ASMARM_CURRENT_H
  2. #define _ASMARM_CURRENT_H
  3.  
  4. static inline unsigned long get_sp(void)
  5. {
  6.     unsigned long sp;
  7.     __asm__ ("mov %0,sp" : "=r" (sp));
  8.     return sp;
  9. }
  10.  
  11. static inline struct task_struct *get_current(void)
  12. {
  13.     struct task_struct *ts;
  14.     __asm__ __volatile__("
  15.     bic    %0, sp, #0x1f00
  16.     bic    %0, %0, #0x00ff
  17.     " : "=r" (ts));
  18.     return ts;
  19. }
  20.  
  21. #define current (get_current())
  22.  
  23. #endif /* _ASMARM_CURRENT_H */
  24.